package com.clps.rulesregulations.service;

import com.clps.rulesregulations.domain.*;
import com.clps.rulesregulations.util.ResourceTree;
import com.github.pagehelper.PageInfo;
import org.jsoup.nodes.Document;

import java.util.List;
import java.util.Map;

/**
 * 制度管理接口
 */
public interface RegulationService {

    List<ResourceTree> findAllAsTree();

    List<ResourceTree> findAllAsTreeByParentId(String id, String parentId);

    List<ResourceTree> findMenuTree();

    List<ResourceTree> findDeptTrees();

    List<Integer> findAllRegulationIds();

    List<Department> selectDepartmentKey();

    List<ResourceTree> findDirAsTree();
    List<ResourceTree> findAllDirAsTree();

    List<Integer> findDirRegulationIds();
    List<Integer> findAllDirRegulationIds();

    PageInfo<Schedule> findAllSchedules(Map<String, Object> condition);

    /**
     * 批量插入目錄
     *
     * @param regulation
     */
    void addRegulations(Regulation regulation);

    void updateRegulationsList(List list);

    void deleteRegulationsList(List list);

    void deleteRuleList(List list);

    Integer getMaxSorder(Integer parentId);

    void saveRule(Rule rule);

    void saveRuleHis(Rule rule);

    void deleteRule(Rule rule);

    Rule selectRule(String id);

    Rule selectRuleByMenuId(String id);

    void fileclickcount(String id);

    Rule selectRuleHis(String id);

    void deleteRuleHis(String id);

    boolean coverfile(Rule rule);

    boolean updateRule(Rule rule);

    void updateRegulationMenu(Rule rule);

    HotSearch getFileHotSearchCount(String id);

    void insertFileHotSearchCount(String id);

    void updateFileHotSearchCount(String id);

    void insertAccessTalbe(AccessFile af);

    void revertRule(String id);

    PageInfo<Rule> findAllRules(Map<String, Object> condition);

    PageInfo<Rule> findAllRulesHis(Map<String, Object> condition);

    PageInfo<Rule> listLatestUpdFile(Map<String, Object> condition);

    PageInfo<Rule> showmoreeditfile(Map<String, Object> condition);

    PageInfo<Rule> showmorehotsearch(Map<String, Object> condition);

    PageInfo<Rule> listkeywordHot(Map<String, Object> condition);

    Regulation selectNewParentInfo(Integer parentId);

    List<String> selectFileExistCount(List list);
    List<String> getDelDirList(Integer id);

    List<String> selectFileDirExistCount(String id);

    Regulation selectRegByParentId(Integer parentId);

    List<Regulation> selectAllRegulations();

    void revertVersion(Rule rule);

    void scheduleEdit(String _id,String name);

    void saveFileAndDir(List<Regulation> addList, List<Regulation> updateList, List<String> fileDirDelList, List<String> existFileList);

    String detailDocxByStyle(Document doc, String catalogId,String upfileName) throws Exception;

    boolean saveword(String title, String catalogId, String content);

    Rule selectCoverRule(String title, Integer catalogId);

    void saveFile(RuleFilelist rf);
    void updateFile(RuleFilelist rf);
    void delFile(RuleFilelist rf);

    List<RuleFilelist> getFileList(String ruleId);

    void updateAttendInfo(Rule rule);

    void addCatalog(Map<String, Object> condition);

    void updateCatalog(Map<String, Object> condition);

    void deleteFile(Map<String, Object> condition);
}
